package work.MrSun.xyq.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import work.MrSun.xyq.mapper.XyqUserMapper;
import work.MrSun.xyq.model.XyqUser;
import work.MrSun.xyq.util.SameService;

import java.util.List;

/**
 * @Author MrSun
 * @Date 2023/4/6 21:42
 */
@Service
public class XyqUserService extends SameService<XyqUser> {
    @Autowired
    private XyqUserMapper xyqUserMapper;

    /**
     * 新用户插入
     *
     * @param mangoUser
     * @return
     */
    public Integer insertUserMessage(XyqUser mangoUser) {
        return xyqUserMapper.insertUserMessage(mangoUser);
    }

    /**
     * 得到符合条件的用户数
     *
     * @param
     * @return
     */

    public Integer getUserCount(XyqUser xyqUser) {
        return xyqUserMapper.selectCount(xyqUser);
    }

    /**
     * 更新用户信息
     *
     * @param
     */
    public void updateUserMessage(XyqUser xyqUser) {
        xyqUserMapper.updateByPrimaryKey(xyqUser);
    }

    /**
     * 返回符合条件的用户信息
     */
    public List<XyqUser> getUserMessageByOtherMessage(XyqUser xyqUser) {
        return xyqUserMapper.select(xyqUser);
    }

}
